package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeeMapper {

    @Select("select * from employee where username=#{username}")
    Employee login(Employee employee);

    @Insert("insert into employee value(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    Integer save(Employee employee);


    List<Employee> findByPage(@Param("name") String name);

    @Select("select *  from employee where id=#{id}")
    Employee findById(Integer id);

    Integer update(Employee employee);

}
